/**
  ETFAna project, Anyang Normal University && IMP-CAS
  \class ETFSource
  \brief the base class of ETFOnlineSource and ETFOfflineSource
  \author SUN Yazhou, asia.rabbit@163.com
  \since 2023-06-26
  \date 2024-06-19 last modified
  \attention
  changelog
  <table>
  <tr>  <th>Date         <th>Author      <th>Description                   </tr>
  <tr>  <td>2023-06-26   <td>Asia Sun    <td>file created                  </tr>
  </table>

  \copyright Copyright (c) 2021-2024 Anyang Normal U. && IMP-CAS with LGPLv3 LICENSE
*/

#include <iostream>
#include "ETFRun.h"

#include "ETFSource.h"
#include "ETFUnpacker.h"
#include "ETFMsg.h"

using std::cout;
using std::endl;

ETFSource::ETFSource() : fEventCnt(0), fUnpackGood(true){}

ETFSource::~ETFSource(){}

// initialize the unpackers
void ETFSource::Init(){
  for(auto u : fUpks) u->Init();
} // end member function Init

void ETFSource::PrintSummary(){
  cout << endl;
  for(auto u : fUpks) u->PrintSummary();

  if(IsClean()) return;
  cout << "\n\033[33;1m:)\033[0m Unpacked data have been written into ";
  cout << "\033[1m" << ROOTFileName() << " \033[33;1m:)\033[0m." << endl;
} // end member function PrintSummary
